<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
			    xmlns:ui="http://java.sun.com/jsf/facelets"
			    xmlns:h="http://java.sun.com/jsf/html"
			    xmlns:f="http://java.sun.com/jsf/core"    
			    template="./template/template_login.xhtml">
    
    <ui:define name="title">
        Editar Ingreso
    </ui:define>
    
    <ui:define name="content">    				
			    		    			    	
 	<div class="box box-50 altbox">
		<div class="boxin">
			<div class="header">
				<h3>Ingresos</h3>
			</div>
			<h:form id="editarIngresoForm" styleClass="fields">
 				<f:event listener="#{receiptsBean.fillDropDownsInsertPage}" type="preRenderView" />
				<fieldset class="last">
					<f:event listener="#{receiptsBean.validateReceiptsForm}" type="postValidate" />					
					<legend><strong>Editar Ingreso</strong></legend>
					<h:messages id="messages" errorClass="msg msg-error" infoClass="msg msg-info" />
					<h:outputLabel value="Mes a pagar:" />
					<h:panelGroup>						
						<h:panelGroup>
							<h:selectOneMenu id="mesId" value="#{receiptsBean.receiptMonth}">
								<f:ajax render="@none" execute="@this" />
		                        <f:selectItem itemValue="1" itemLabel="Enero" />
		                        <f:selectItem itemValue="2" itemLabel="Febrero" />
		                        <f:selectItem itemValue="3" itemLabel="Marzo" />
		                        <f:selectItem itemValue="4" itemLabel="Abril" />
		                        <f:selectItem itemValue="5" itemLabel="Mayo" />
		                        <f:selectItem itemValue="6" itemLabel="Junio" />
		                        <f:selectItem itemValue="7" itemLabel="Julio" />
		                        <f:selectItem itemValue="8" itemLabel="Agosto" />
		                        <f:selectItem itemValue="9" itemLabel="Septiembre" />
		                        <f:selectItem itemValue="10" itemLabel="Octubre" />
		                        <f:selectItem itemValue="11" itemLabel="Noviembre" />
		                        <f:selectItem itemValue="12" itemLabel="Diciembre" />
							</h:selectOneMenu> &#160;
							<h:selectOneMenu id="anioId" value="#{receiptsBean.receiptYear}" >
								<f:ajax render="@none" execute="@this" />                        
		                        <f:selectItem itemValue="2010" itemLabel="2010" />
		                        <f:selectItem itemValue="2011" itemLabel="2011" />
		                        <f:selectItem itemValue="2012" itemLabel="2012" />
		                        <f:selectItem itemValue="2013" itemLabel="2013" />
		                        <f:selectItem itemValue="2014" itemLabel="2014" />
		                        <f:selectItem itemValue="2015" itemLabel="2015" />
		                        <f:selectItem itemValue="2016" itemLabel="2016" />
		                        <f:selectItem itemValue="2017" itemLabel="2017" />
		                        <f:selectItem itemValue="2018" itemLabel="2018" />
		                        <f:selectItem itemValue="2019" itemLabel="2019" />
		                        <f:selectItem itemValue="2020" itemLabel="2020" />
							</h:selectOneMenu>									
						</h:panelGroup>
					</h:panelGroup>	
														
					<h:outputLabel value="Importe" />					
					<h:inputText id="importeId" styleClass="txt" value="#{receiptsBean.receiptsEditView.amount}"  onfocus="this.select();" onkeydown="return (numeric(event, 1) &amp;&amp; noPaste(event, this));" onkeyup="extractNumber(this,2,false);" />
					
					<h:outputLabel value="Condomino" />					
					<h:selectOneMenu id="condominoId" value="#{receiptsBean.receiptsEditView.condominiumsView.id}">
	  						<f:selectItems value="#{receiptsBean.condominiumsList}" />
					</h:selectOneMenu>
					
					
					<h:outputLabel value="Tipo de Ingreso" />
					<h:selectOneMenu id="tipoIngresoId" value="#{receiptsBean.receiptsEditView.receiptsItemView.id}">
	  						<f:selectItems value="#{receiptsBean.receiptsList}" />
					</h:selectOneMenu>
					
					<h:outputLabel value="Comentarios" />					
					<h:inputTextarea styleClass="campo_texto" value="#{receiptsBean.receiptsEditView.comments}"  onfocus="this.select();" cols="40" rows="5" />					
					
					<div class="sep">
						<h:commandButton id="submit" styleClass="button altbutton" value="Editar" action="#{receiptsBean.updateReceiptsAction}" /> &nbsp;&nbsp;
		      			<h:commandButton id="back" styleClass="button" value="Regresar" action="#{receiptsBean.backAction}" immediate="true" />										
					</div>
			</fieldset>
			</h:form>
		</div>
	</div>    			    			    			    				    												
	</ui:define>
    
</ui:composition>